package trabajoISW2.data;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * A simple base class for all dao's. It offers 2 features. First, it has the
 * entity manager attribute. Second, it makes it possible to have a common test
 * base class with the getDao() method to allow for automatic initialization.
 */
public abstract class BaseDAO {
	private static final String persistenceUnit = "trabajoISW2.domain.implementations";
	private final EntityManagerFactory emf = Persistence.createEntityManagerFactory(persistenceUnit);
	private final EntityManager em = emf.createEntityManager();
 

	public EntityManagerFactory getEmf(){
		return emf;
	}
 
    public EntityManager getEm() {
    	
        return em;
    }

}